package net.cyndeline.rlgraph.util

import scalax.collection.GraphPredef.{OuterEdge, EdgeLikeIn}

/**
 * Creates a graph edge based on another edge by copying all data except to/from values.
 * NN
 */
trait EdgeCopyFactory[VType, EType[X] <: EdgeLikeIn[X]] {

  /**
   * Copies an edge and assigns the copy new vertices.
   *
   * @param edge Old edge to copy.
   * @param a A vertex to assign the new edge. If the edge is directed, this is the .from value.
   * @param b A vertex to assign the new edge. If the edge is directed, this is the .to value.
   * @return a copy of the edge with new vertices assigned. If the same copying is performed multiple times,
   *         an equal copy is returned every time.
   */
  def copyEdge(edge: EType[VType], a: VType, b: VType): EType[VType] with OuterEdge[VType, EType]

}
